package Json;

import com.google.gson.Gson;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Ajie
 * @date 2022/5/13
 * @function 出现非法的反斜杠
 */
public class JsonToStringIllagestr {
    public static void main(String[] args) {
        Gson gson = new Gson();
        Map<String,Object> map = new HashMap<>();
        map.put("personalService","个人");
        map.put("userGroupService","用户组");
        map.put("territoryService","地域");
        map.put("organizationService","组织机构");
        System.out.println(gson.toJson(map));
        System.out.println(gson.toJson(gson.toJson(map)));

        System.out.println(gson.toJson(gson.toJson(map)).replace("\\\"",""));
    }
}
